package com.example.tliasmanagement.controller;

import com.example.tliasmanagement.service.ReportService;
import com.example.tliasmanagement.vo.EmpJobDataVo;
import com.example.tliasmanagement.vo.NameValueVo;
import com.example.tliasmanagement.vo.Result2;
import com.example.tliasmanagement.vo.StudentNumberVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 报表接口
 */
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    /**
     *  统计员工职位信息
     * */
    @GetMapping("/empJobData")
    public Result2<EmpJobDataVo> empJobData() {
        EmpJobDataVo vo = reportService.empJobData();
        return Result2.ok(vo);
    }
    /**
     *  统计员工性别信息
     * */
    @GetMapping("/empGenderData")
    public Result2<List<NameValueVo>> empGenderData(){
        List<NameValueVo> voList = reportService.empGenderData();
        return Result2.ok(voList);
    }
    /**
     *  统计班级人数信息
     * */
    @GetMapping("/studentCountData")
    public Result2<StudentNumberVo> studentCountData(){
        StudentNumberVo vo = reportService.studentCountData();
        return Result2.ok(vo);
    }
    /**
     *  统计班级学历信息
     * */
    @GetMapping("/studentDegreeData")
    public Result2<List<NameValueVo>> studentDegreeData(){
        List<NameValueVo> voList = reportService.studentDegreeData();
        return Result2.ok(voList);
    }
}